#pragma once

#include"hash.h"

template<class K>
class UnorderedSet
{
	struct KeyOfSet
	{
		const K& operator()(const K& key)
		{
			return key;
		}
	};
public:
	typedef typename HashTable<K, K, KeyOfSet>::const_iterator iterator;
	typedef typename HashTable<K, K, KeyOfSet>::const_iterator const_iterator;

	iterator begin() const
	{
		return _ht.Begin();
	}

	iterator end() const
	{
		return _ht.End();
	}

	pair<iterator, bool> insert(const K& key)
	{
		pair<typename HashTable<K, K, KeyOfSet>::iterator, bool> ret = _ht.Insert(key);
		return pair<iterator, bool>(ret.first, ret.second);
	}

	
private:
	HashTable<K, K, KeyOfSet> _ht;
};